import java.util.ArrayList;

public class ObjectStructure {
    private ArrayList<Person> persons = new ArrayList<>();

    public void addPerson(Person p){
        persons.add(p);
    }

    public void removePerson(Person p){
        persons.remove(p);
    }

    public void display(Action action){
        for (Person person : persons) {
            person.accept(action);
        }
    }

}
